#pragma once
#include <string>
#include <map>
#include "../../PocelainMacro.h"
#include "../../core/Ref.h"
#include "../EShaderType.h"
POCELAIN_NAMESPACE_BEGIN
class OpenGLShaderProgram;
class POCELAIN_EXPORT OpenGLShader: public Ref
{
    friend OpenGLShaderProgram;
public:
    OpenGLShader(EShaderType shdaerType);
    virtual ~OpenGLShader();
    void clear();
    bool isValid()const;
    virtual EShaderType getShaderType()const { return mShaderType;}
    virtual void resetByString(
        const std::string &content,
        bool isRawShader = false
        );
    GLuint getShaderID()const{return mShaderId;}
    const std::string &getShaderString()const{return mShaderString;};
protected:
    EShaderType mShaderType = EShaderType::E_UNKNOWN;
    GLuint mShaderId = 0;
    std::string mShaderString;
    std::string mRawShaderString;
    bool mIsDirty = true;
    bool mIsRawShader = false;
};
POCELAIN_NAMESPACE_END
